package com.cangshukj.junong.domain;

import com.cangshukj.common.annotation.Excel;
import com.cangshukj.common.core.domain.BaseEntity;
import com.cangshukj.system.domain.SysRegion;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotEmpty;
import java.util.ArrayList;
import java.util.List;

/**
 * 销售服务分类对象 sales_type
 * 
 * @author wangjie
 * @date 2025-04-01
 */
@ApiModel("销售服务分类")
public class SalesType extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 分类ID */
    @ApiModelProperty("分类ID")
    private String typeId;

    /** 上级分类ID */
    @ApiModelProperty("上级分类ID ")
    @Excel(name = "上级分类ID")
    private String pid;

    /** 分类名称 */
    @ApiModelProperty("分类名称 ")
    @Excel(name = "分类名称")
    private String typeName;

    /** 是否有子地区 */
    @ApiModelProperty("是否有子地区")
    private boolean hasChildren;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<SalesType> children = new ArrayList<>();

    public boolean isHasChildren() {
        return hasChildren;
    }

    public void setHasChildren(boolean hasChildren) {
        this.hasChildren = hasChildren;
    }

    public List<SalesType> getChildren() {
        return children;
    }

    public void setChildren(List<SalesType> children) {
        this.children = children;
    }

    public void setTypeId(String typeId)
    {
        this.typeId = typeId;
    }

    public String getTypeId() 
    {
        return typeId;
    }
    public void setPid(String pid) 
    {
        this.pid = pid;
    }

    public String getPid() 
    {
        return pid;
    }
    public void setTypeName(String typeName) 
    {
        this.typeName = typeName;
    }

    public String getTypeName() 
    {
        return typeName;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
            .append("typeId", getTypeId())
            .append("pid", getPid())
            .append("typeName", getTypeName())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
